{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    <a class="btn btn-success" href="{:\\think\\Url::build('','file=build.php')}" target="download">下载文件</a>
    <div id="markdown" class="mt-20"></div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/showdown/1.4.2/showdown.min.js"></script>
<script>
    $(function () {
        var converter = new showdown.Converter(),
                text      = $("#markdown_tpl").html();
        $("#markdown").html(converter.makeHtml(text));
    })
</script>
<script type="text/plain" id="markdown_tpl">
---
方法：
```
/File::download($file_path,$file_name = '',$file_size = '',$ext='');
```
助手函数：
```
download($file_path,$file_name = '',$file_size = '',$ext='');
```
html 代码：
```
<a class="btn btn-success" href="{:\\think\\Url::build('','file=build.php')}" target="download">下载文件</a>
```
php 代码：
```
public function download()
{
    if ($this->request->param('file')) {
        return \File::download("../build.php");
    } else {
        return $this->view->fetch();
    }
}
```
</script>
{/block}